import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

//数据访问
import axios from 'axios'
// 添加JWT token信息
axios.defaults.headers.common["Authorization"] = "Bearer " + window.localStorage.getItem("token");
//设置基础路径

axios.defaults.baseURL = 'http://localhost:44228/api/'

//element-plus 配置
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'


import App from './App.vue'
import router from './router'

const app = createApp(App)
app.use(createPinia())
app.use(router)
//数据访问组件 注入
app.provide('axios', axios)
//element-plus 配置
app.use(ElementPlus, {
    locale: zhCn,
})
app.mount('#app')
